exports.searchApiDocsDetail = function (req, res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;

    //返回结果
    var resultData = {};

    //任务流创建
    async.waterfall([

        (cb) => {

            //获取接口详情
            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.actionPermissionsSearch.Request_Api_Url + "/ap_id/"+ restfulParams.ap_id,
                    method : 'GET'
                },
                function (data) {

                    resultData.apiData = data.result.data[0];
                    
                    cb();
                    
                }
            )

        },

        //获取请求参数信息    
        (cb) => {

            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.requestParameterSearch.Request_Api_Url + "/rp_apid/"+ restfulParams.ap_id,
                    method : 'GET'
                },
                function (data) {

                    resultData.apiData.apiRequestData = data.result.data;
                    
                    cb();
                    
                }
            )
        },

        //根据请求参数拆分POST和GET请求数组
        (cb) => {

            var postArr = [];
            var getArr  = [];

            for(var i = 0;i<resultData.apiData.apiRequestData.length;i++){

                if(resultData.apiData.apiRequestData[i].rp_way == 'BODY'){
                    postArr.push(resultData.apiData.apiRequestData[i])
                }else{
                    getArr.push(resultData.apiData.apiRequestData[i])
                }

            }

            resultData.apiData.postArr = postArr;
            resultData.apiData.getArr  = getArr;

            cb();
            
        }

    ],()=> {

        //返回最终拼接结果
        RES.successResponse(res, resultData);

    });

}